new Vue({
    el:'#main',
    data:{
        newRole:{
          id:'',
          name:'',
          series:'',
          strongPoint:''

        },
        roleList:[],
    },
    methods:{
        createRole(){
            for(const val in this.newRole){
                if(this.newRole[val].trim() ===''){
                    alert('每一项都必须填写');
                    return;
                }
            }
            this.roleList.push(this.newRole);
            this.newRole = {
                id:'',
                name:'',
                series:'',
                strongPoint:''
            }
        }
    }
})